﻿using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Cemit.PolyServer
{
    /// <summary>
    /// 读取Json配置，Json配置使用“{{}}”支持变量
    /// 支持变量示例： { "Root": "Configs", "AppConfigs": "{{Root}}/AppConfigs.json" }）
    /// </summary>
    public static class Jsons
    {
        const string path = @"Configs";

        /// <summary>
        /// 返回配置文件
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public static JsonConfigs Get(string fileName)
        {
            return new JsonConfigs(Path.Combine(path, fileName + ".json"));
        }
    }
}
